#include "connection_manager.h"

void ConnectionManager::start(std::shared_ptr<Connection> connection) {
    connections_.insert(connection);
    connection->start();
}

void ConnectionManager::stop(std::shared_ptr<Connection> connection) {
    connections_.erase(connection);
    connection->stop();
}

void ConnectionManager::stop_all() {
    for (auto& connection : connections_) {
        connection->stop();
    }
    connections_.clear();
}

size_t ConnectionManager::get_connection_count() {
    return connections_.size();
}